import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'


// const About = () => import(/* webpackChunkName: "about" */ '../views/About.vue')

Vue.use(VueRouter)


export const menu_list = [
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About/About.vue'),
    title:"总标题一",
    icon:"el-icon-document",
    children:[
     {
      path:"/about",
      component: () => import(/* webpackChunkName: "about" */ '../views/About/AboutOne.vue'),
      title:"副标题1-1",
      icon:"el-icon-document",
     },
     {
      path:"/about2",
      component: () => import(/* webpackChunkName: "about" */ '../views/About/AboutTwo.vue'),
      title:"副标题1-2",
      icon:"el-icon-warning",
     },
     {
      path:"/about3",
      component: () => import(/* webpackChunkName: "about" */ '../views/About/AboutThree.vue'),
      title:"副标题1-3",
      icon:"el-icon-warning",
     },
     {
      path:"/about4",
      component: () => import(/* webpackChunkName: "about" */ '../views/About/AboutFour.vue'),
      title:"副标题1-4",
      icon:"el-icon-document",
     },
     {
      path:"/about5",
      component: () => import(/* webpackChunkName: "about" */ '../views/About/AboutFive.vue'),
      title:"副标题1-5",
      icon:"el-icon-document",
     }
    ]
  },
  {
    path:'/scrolltest',
    name:'scrolltest',
    title:"总标题二",
    icon:"el-icon-setting",
    component:() => import('../views/Scroll/Scroll.vue'),
    children:[
      {
        path:"/scrolltest",
        component:() => import('../views/Scroll/ScrollTest.vue'),
        title:"副标题2-1",
        icon:"el-icon-warning",
      },
      {
        path:"/testDemo",
        component:() => import('../views/Scroll/testDemo.vue'),
        title:"副标题2-2",
        icon:"el-icon-warning",
      },
      {
        path:"/demoTwo",
        component:() => import('../views/Scroll/demoTwo.vue'),
        title:"副标题2-3",
        icon:"el-icon-warning",
      },
      {
        path:"/demoThree",
        component:() => import('../views/Scroll/demoThree.vue'),
        title:"副标题2-4",
        icon:"el-icon-warning",
      }
    ]
  },
  {
    path:'/testThree',
    name:'testThree',
    title:"总标题三",
    icon:"el-icon-setting",
    component:() => import('../views/TestThree/TestThree.vue'),
    children:[
      {
        path:"/testThree",
        component:() => import('../views/TestThree/testOne.vue'),
        title:"测试3-1",
        icon:"el-icon-warning",
      },
      {
        path:"/testThree2",
        component:() => import('../views/TestThree/testTwo.vue'),
        title:"测试3-2",
        icon:"el-icon-bangzhu",
      },
      {
        path:"/testThree3",
        component:() => import('../views/TestThree/TestFour.vue'),
        title:"测试3-3",
        icon:"el-icon-bangzhu",
      }
    ]
  },
  {
    path:'/testFour',
    name:'testFour',
    title:"总标题四",
    icon:"el-icon-setting",
    component:() => import('../views/Four/Four.vue'),
    children:[
      {
        path:"/testFour",
        component:() => import('../views/Four/fourTestOne.vue'),
        title:"测试4-1",
        icon:"el-icon-warning",
      },
      {
        path:"/testFourTwo",
        component:() => import('../views/Four/FourTestTwo.vue'),
        title:"测试4-2",
        icon:"el-icon-warning",
      },
      {
        path:"/testFourThree",
        component:() => import('../views/Four/FourTestThree.vue'),
        title:"测试4-3",
        icon:"el-icon-warning",
      },
      {
        path:"/testFourFour",
        component:() => import('../views/Four/FourTestFour.vue'),
        title:"测试4-4",
        icon:"el-icon-warning",
      },
      {
        path:"/testFourfive",
        component:() => import('../views/Four/FourFive.vue'),
        title:"测试4-5",
        icon:"el-icon-warning",
      },
      {
        path:"/swiper",
        component:() => import('../views/Four/swiper.vue'),
        title:"swiper",
        icon:"el-icon-warning",
      },
      {
        path:"/daojishi",
        component:() => import('../views/Four/daojishi.vue'),
        title:"daojishi",
        icon:"el-icon-warning",
      },
    ]
  },
  {
    path:'/testFive',
    name:'testFive',
    title:"总标题五",
    icon:"el-icon-setting",
    component:() => import('../views/Five/five.vue'),
    children:[
      {
        path:"/testFive",
        component:() => import('../views/Five/slider.vue'),
        title:"测试5-1",
        icon:"el-icon-warning",
      },
      {
        path:"/button",
        component:() => import('../views/Five/button.vue'),
        title:"测试5-2",
        icon:"el-icon-warning",
      },
      {
        path:"/ppchart",
        component:() => import('../views/Five/ppchart.vue'),
        title:"测试5-3",
        icon:"el-icon-warning",
      },
      {
        path:"/cssStyle",
        component:() => import('../views/Five/fiveFour.vue'),
        title:"测试5-4",
        icon:"el-icon-warning",
      },
      {
        path:"/texiao",
        component:() => import('../views/Five/texiao.vue'),
        title:"测试5-5",
        icon:"el-icon-warning",
      },
    ]
  },
  {
    path:'/testSix',
    name:'testSix',
    title:"总标题六",
    icon:"el-icon-setting",
    component:() => import('../views/Six/six.vue'),
    children:[
      {
        path:"/testSix",
        component:() => import('../views/Six/sixOne.vue'),
        title:"测试6-1",
        icon:"el-icon-warning",
      },
      {
        path:"/sixTwo",
        component:() => import('../views/Six/sixTwo.vue'),
        title:"测试6-2",
        icon:"el-icon-warning",
      },
      {
        path:"/sixThree",
        component:() => import('../views/Six/sixThree.vue'),
        title:"测试6-3",
        icon:"el-icon-warning",
      },
      {
        path:"/sixFour",
        component:() => import('../views/Six/sixFour.vue'),
        title:"测试6-4",
        icon:"el-icon-warning",
      },
    ]
  }
]


const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  ...menu_list
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
